<template>
  <div class="detail">
    <el-breadcrumb>
      <el-breadcrumb-item :to="{path:'/'}">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/bid/list'}">公告列表页</el-breadcrumb-item>
      <el-breadcrumb-item >公告详情页</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="main">
      <h1 class="title">{{ title }}</h1>
      <div class="publish">
        <span style="font-size: 14px;color: #333;">发布企业：</span>
        <span style="font-size: 14px;color: #666;margin-right: 14px;">{{ publisher }}</span>
        <span style="font-size: 14px;color: #333;">发布时间：</span>
        <span style="font-size: 14px;color: #666;">{{ publishDataTime }}</span>
      </div>
      <div class="bidContent" ref="bidContent"></div>
      <div class="download">
        <li v-for="item in fileList">
          <template @click="downFile(item.fileName)">
            <span>附件：</span>
            <span>{{ item.fileName }}</span>
          </template>
        </li>
      </div>
    </div>
  </div>
</template>

<script>
import {getBidding} from '../../api/bid/enterprise'
import {download} from '../../utils/neu'
export default {
  name: "detail",
  methods: {
    downFile(fileName){
      download(fileName)
    }
  },
  data() {
    return {
     id:null,
     title:'',
     publisher:'',
     publishDataTime:'',
     content:'',
     fileList:[]
    }
  },
  async created() {
    this.id = this.$route.query.id
   getBidding(this.id).then(res=>{
    console.log(res);
    this.title = res.data.bidTitle
    this.publisher = res.data.bidPublisher
    this.publishDataTime = res.data.bidPublishDatetime
    this.content = res.data.bidContent
    this.fileList = res.data.filesList
    this.$refs.bidContent.innerHTML = this.content

   })
  },
  mounted() {
    
  },

}
</script>

<style lang="scss" scoped>
.main{
  margin: 20px;
  
  .title{
    font-size: 28px;
    margin-bottom: 30px;
  }

  .publish{
    margin-bottom: 30px;
  }
  .bidContent{
    text-align: left;
  }

  .download{
    li{
      list-style: none;
      font-size: 14px;
      color: gray;
      cursor: pointer;
      text-align: left;
      
    }
    :hover{
      color: #1dd0b7;
    }
  }
}
</style>
